<?php 
header("content-type:text/html;charset=utf8");
//接id
$c_id=$_GET["id"];
// print_r($c_id);die;
if(!empty($c_id))
{
	echo "<script>if(!confirm('您确定要删除?'))history.go(-1)</script>";
    //连选库
	$db=new PDO("mysql:host=127.0.0.1;dbname=bj07c;charset=utf8","root","root");
	$sql="delete from class where c_id=$c_id";
	$res=$db->exec($sql);
	// print_r($res);die;
	if($res)
	{
	   echo "<script>alert('删除成功');location.href='show.php'</script>";
	}
	else
	{
	  echo "<script>alert('删除失败');location.href='show.php'</script>";
	}
}

 ?>
